/// 用户
class UserModel {
  int? id;
  String? name;
  String? nickname; // 姓名
  String? phone; // 手机号
  String? userId; // 腾讯IM userId
  String? email;
  int? phone_verified_at;
  String? avatar;
  int? gender;
  String? birth_date;
  String? bio;
  String? account_status;
  String? last_action_time;
  String? personal_config_json;
  String? authentication_status;
  int? likes_count;
  int? following_count;
  int? followers_count;
  String? nationality;
  String? created_at;
  String? updated_at;

  UserModel({
    this.id,
    this.name,
    this.nickname,
    this.phone,
    this.userId,
    this.email,
    this.phone_verified_at,
    this.avatar,
    this.gender,
    this.birth_date,
    this.bio,
    this.account_status,
    this.last_action_time,
    this.personal_config_json,
    this.authentication_status,
    this.likes_count = 0,
    this.following_count = 0,
    this.followers_count = 0,
    this.nationality,
    this.created_at,
    this.updated_at,
  });

  factory UserModel.fromJson(Map<String, dynamic> json) {
    return UserModel(
      id: json["id"],
      name: json["name"],
      nickname: json["nickname"],
      phone: json["phone"],
      userId: json["userId"],
      email: json["email"],
      phone_verified_at: json["phone_verified_at"],
      avatar: json["avatar"],
      gender: json["gender"],
      birth_date: json["birth_date"],
      bio: json["bio"],
      account_status: json["account_status"],
      last_action_time: json["last_action_time"],
      personal_config_json: json["personal_config_json"],
      authentication_status: json["authentication_status"],
      likes_count: json["likes_count"],
      following_count: json["following_count"],
      followers_count: json["followers_count"],
      nationality: json["nationality"],
      created_at: json["created_at"],
      updated_at: json["updated_at"],
    );
  }

  Map<String, dynamic> toJson() {
    return {
      "id": id,
      "name": name,
      "nickname": nickname,
      "phone": phone,
      "userId": userId,
      "email": email,
      "phone_verified_at": phone_verified_at,
      "avatar": avatar,
      "gender": gender,
      "birth_date": birth_date,
      "bio": bio,
      "account_status": account_status,
      "last_action_time": last_action_time,
      "personal_config_json": personal_config_json,
      "authentication_status": authentication_status,
      "likes_count": likes_count,
      "following_count": following_count,
      "followers_count": followers_count,
      "nationality": nationality,
      "created_at": created_at,
      "updated_at": updated_at,
    };
  }
}
